
package com.qdu.servlet;
import com.qdu.entity.Ncomment;
import com.qdu.service.NcommentService;
import com.qdu.service.impl.NcommentServiceImpl;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author 12068
 */
@WebServlet("/xxx")
public class AddNcommentServlet extends HttpServlet{
    NcommentService ss= new NcommentServiceImpl();
     @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {


        req.setCharacterEncoding("utf-8");
        int Uno = Integer.parseInt(req.getParameter("Uno"));
        String Uname = req.getParameter("Uname");
        String Ncom = req.getParameter("Ncom");
        int Nno = Integer.parseInt(req.getParameter("Nno"));


        Ncomment ncoment = new Ncomment(Uno,Uname,Ncom,Nno);
        int rows =  ss.addNcomment(ncoment);
     
        resp.getWriter().println(rows);
}
}
